#! /usr/bin/env python
# encoding: utf-8
import sys 

def options(opt):
    opt.load('compiler_cxx')
    opt.load('java')

def configure(conf):
    conf.load('compiler_cxx')
    conf.load('java')
    conf.check_jni_headers()
    if sys.platform == 'win32' and conf.env.CXX_NAME == 'gcc' :
        conf.env.DEFINES = ['MINGW']
        conf.env.LINKFLAGS = ['-static-libgcc', '-static-libstdc++']
    conf.env.INCLUDES = [ '.', '..']
    conf.env.CXXFLAGS = ['-Wall', '-O3', '-fPIC' ]
    conf.env.CORE_SRC = ['core/*.C']
    conf.env.JNI_SRC = ['jni/*.cpp']

def build(bld):
    bld.objects( source = bld.path.ant_glob(bld.env.CORE_SRC), target = 'core' )
    bld.shlib( source = bld.path.ant_glob(bld.env.JNI_SRC), uselib = 'JAVA', use = 'core', target = 'minisatprover' )

   
